<template>
  <div class="item-box">
    <div class="item-left">
      <div class="left-title-box">
        <titles :title="props.info.text" />
      </div>
      <div class="left-textMax-box">
        <textMax :maxLen="80" :data="props.info.remarks" />
      </div>
    </div>
    <div class="item-right">
      <div class="right-item1">
        <div class="img-style-1 items-box">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[0])"
            :src="
              props.info.children[0].value
                ? urls + props.info.children[0].value + '?imageView2/1/w/280/h/160/format/webp'
                : 'http://101.34.143.36:8890/api/image/387939155165253/h_160,w_280'
            "
            alt=""
          />
        </div>
        <div class="img-style-2 items-box">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[1].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[1].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[1])"
            :src="
              props.info.children[1].value
                ? urls + props.info.children[1].value + '?imageView2/1/w/400/h/240/format/webp'
                : 'http://101.34.143.36:8890/api/image/387939155165253/h_240,w_400'
            "
            alt=""
          />
        </div>
      </div>
      <div class="right-item2">
        <div class="img-style-3 items-box">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[2].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[2].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[2])"
            :src="
              props.info.children[2].value
                ? urls + props.info.children[2].value + '?imageView2/1/w/280/h/210/format/webp'
                : 'http://101.34.143.36:8890/api/image/387939155165253/h_210,w_280'
            "
            alt=""
          />
        </div>
        <div class="img-style-4 items-box">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[3].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[3].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[3])"
            :src="
              props.info.children[3].value
                ? urls + props.info.children[3].value + '?imageView2/1/w/380/h/160/format/webp'
                : 'http://101.34.143.36:8890/api/image/387939155165253/h_210,w_280'
            "
            alt=""
          />
        </div>
        <div class="img-style-5 items-box">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[4].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[4].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[4])"
            :src="
              props.info.children[4].value
                ? urls + props.info.children[4].value + '?imageView2/1/w/340/h/160/format/webp'
                : 'http://101.34.143.36:8890/api/image/387939155165253/h_210,w_280'
            "
            alt=""
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { handlemouse } from '@/utils/minxin';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';

const router = useRouter();
const route = useRoute();
const props = defineProps({
  info: {
    type: Object,
  },
});
const store = useProjectStore();
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
onMounted(() => {});
</script>

<style lang="less" scoped>
@import './index.less';
.item-box {
  position: relative;
  display: flex;
  width: 100%;
}
.item-left {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 300px;
  padding-right: 50px;
  .left-title1 {
    margin-top: 300px;
  }
  .title-flot {
    position: absolute;
    right: 0;
    top: 0;
  }
}
.item-right {
  display: flex;
  width: 65%;
  .right-item1 {
    width: 50%;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    img {
      width: 100%;
    }
  }
  .right-item2 {
    flex: 1;
    margin-left: 20px;
    img {
      width: 100%;
    }
  }
}
.img-style-1 {
  position: relative;
  width: auto;
  height: 160px;
  margin-top: 80px;
  img {
    width: 100%;
    height: 160px;
  }
}
.img-style-2 {
  position: relative;
  width: auto;
  height: 240px;
  margin-top: 20px;
  img {
    width: 100%;
    height: 240px;
  }
}
.img-style-3 {
  position: relative;
  width: auto;
  height: 200px;
  img {
    height: 200px;
    width: 100%;
  }
}
.img-style-4 {
  position: relative;
  width: auto;
  height: 160px;
  margin: 20px 0;
  img {
    height: 160px;
    width: 100%;
  }
}
.img-style-5 {
  position: relative;
  width: auto;
  height: 160px;
  img {
    width: 100%;
    height: 160px;
  }
}
.left-title-box {
  position: absolute;
  top: 100px;
  right: -60px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.left-textMax-box {
  margin-top: 310px;
}
.text-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .title {
  }
  .left-title1 {
    line-height: 28px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden; //溢出内容隐藏
    text-overflow: ellipsis; //文本溢出部分用省略号表示
    display: -webkit-box; //特别显示模式
    -webkit-line-clamp: 2; //行数
    line-clamp: 2;
    -webkit-box-orient: vertical; //盒子中内容竖直排列
  }
}
.items-box:hover {
  .text-box {
    opacity: 1;
  }
}
</style>
